package hu.myai.test.util;

import hu.myai.api.indicators.AbstractIndicatorConsumer;
import hu.myai.model.IndicatorVO;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class DataProviderIndicatorConsumer extends AbstractIndicatorConsumer {

	private List<Map<String, IndicatorVO>> indicatorMapList = new ArrayList<Map<String,IndicatorVO>>();

	@Override
	protected void startCalculation() {
		indicatorMapList.add(new HashMap<String, IndicatorVO>(indicatorMap));
	}

	public double getIndicatorValue(int index, String name){
		return indicatorMapList.get(index).get(name).getValue();
	}
	
	public void reset(){
		indicatorMapList.clear();
	}
}
